#include "Object.h"

#include "OgreFrameWork.h"


#include "component/ComponentRenderable.h"
#include "component/ComponentPosition.h"

#include "Util.h"


unsigned int Object::m_id=0;

Object::Object()
{


}

Object::~Object()
{
    //dtor

}




/** @brief getType
  *
  * @todo: document this function
  */
OBJ_TYPE Object::getType()
{
    return OBJ_TYP_OBJECT;
}

/** @brief clear
  *
  * @todo: document this function
  */
void Object::clear()
{



}

/** @brief update
  *
  * @todo: document this function
  */
void Object::update(double timeSinceLastFrame)
{
    ComponentManager::update(timeSinceLastFrame);
}

/** @brief init
  *
  * @todo: document this function
  */
void Object::init()
{
initializeAllComponents();
}

Ogre::Vector3 Object::getPosition()
{
    if (hasComponent("Position"))
     return ((ComponentPosition*)getComponent("Position"))->getPosition();
    return Ogre::Vector3::ZERO;
}

void Object::setPosition(  Ogre::Vector3 _position)
{


    if (hasComponent("Position"))
     ((ComponentPosition*)getComponent("Position"))->setPosition(_position);

}
